package org.ecpkn.PAGridSim.core.gridsimEntity.paResourceCharacteristics;

import gridsim.ResourceCharacteristics;

import org.ecpkn.PAGridSim.core.gridsimEntity.paMachine.PAMachine;
import org.ecpkn.PAGridSim.core.gridsimEntity.paMachine.PAMachineList;

public class PAResourceCharacteristics extends ResourceCharacteristics {

	public PAMachineList awakePAMachineList;


	public PAResourceCharacteristics(String architecte, String os,
			PAMachineList mList, int resourceShareMode, double timeZone,
			double cost) {
		super(architecte, os, mList, resourceShareMode, timeZone, cost);
		awakePAMachineList=new PAMachineList();
	}

	public PAMachineList getPAMachineList() {
		return (PAMachineList) getMachineList();
	}

	public PAMachineList getAwakePAMachineList() {
		return awakePAMachineList;
	}

	public int getAwakeMachineNumber() {
		return this.awakePAMachineList.size();
	}

	public void updateAwakePAMachineList() {
		awakePAMachineList = new PAMachineList();
		for (int i = 0; i < this.getMachineList().size(); i++) {
			PAMachine pam = getPAMachineList().get(i);
			if (pam.isTurnedOn()) {
				awakePAMachineList.add(pam);
			}
		}
	}



}
